﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarHelpDesk.Web.Models.Repositories
{
    public interface IImagesRepository
    {
        /// <summary>
        /// saves image to Image table and to QuesionsImage tbl
        /// </summary>
        /// <param name="img">new image to save</param>
        /// <param name="itemID">question id</param>
        void SaveQuestionImage(Image img, int itemID );
       
        /// <summary>
        /// saves image to Image tbl and to AnswersImage tbl
        /// </summary>
        /// <param name="img">new image to save</param>
        /// <param name="itemID">answer id</param>
        void SaveAnswerID(Image img, int itemID);
        
        /// <summary>
        /// Retrieve image by id
        /// </summary>
        /// <param name="imageID">id of image to look for</param>
        /// <returns>image with given id</returns>
        Image GetImageByID(int imageID);

        /// <summary>
        /// Delete all images associated with an existing Answer.
        /// </summary>
        /// <param name="answerID"></param>
        void DeleteAllImagesByAnswerID(int answerID);

        /// <summary>
        /// Retrives all images, attached to question with id = itemID
        /// </summary>
        /// <param name="itemID">question id</param>
        /// <returns>images collection, attached to question</returns>
        List<Image> GetQuestionImages(int itemID);

        /// <summary>
        /// Retrives all images, attached to answer with id = itemID
        /// </summary>
        /// <param name="itemID">answer id</param>
        /// <returns>images collection, attached to an answer</returns>
        List<Image> GetAnswerImages(int itemID);
    }
}
